package com.weitu.contractor.service.impl;

import com.weitu.contractor.entity.ManagerCertHistory;
import com.weitu.contractor.entity.ManagerCertHistoryCriteria;
import com.weitu.contractor.mapper.ManagerCertHistoryMapper;
import com.weitu.contractor.service.ManagerCertHistoryService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class ManagerCertHistoryServiceImpl implements ManagerCertHistoryService {
    private final ManagerCertHistoryMapper managerCertHistoryMapper;

    private static final Logger logger = LoggerFactory.getLogger(ManagerCertHistoryServiceImpl.class);

    @Autowired
    public ManagerCertHistoryServiceImpl(ManagerCertHistoryMapper managerCertHistoryMapper) {
        this.managerCertHistoryMapper = managerCertHistoryMapper;
    }

    @Override
    public int countByCriteria(ManagerCertHistoryCriteria example) {
        int count = this.managerCertHistoryMapper.countByCriteria(example);
        logger.debug("count: {}", count);
        return count;
    }

    @Override
    public ManagerCertHistory selectByPrimaryKey(String id) {
        return this.managerCertHistoryMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<ManagerCertHistory> selectByCriteria(ManagerCertHistoryCriteria example) {
        return this.managerCertHistoryMapper.selectByCriteria(example);
    }

    @Override
    @Transactional
    public int deleteByPrimaryKey(String id) {
        return this.managerCertHistoryMapper.deleteByPrimaryKey(id);
    }

    @Override
    @Transactional
    public int updateByPrimaryKeySelective(ManagerCertHistory record) {
        return this.managerCertHistoryMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    @Transactional
    public int updateByCriteriaSelective(ManagerCertHistory record, ManagerCertHistoryCriteria example) {
        return this.managerCertHistoryMapper.updateByCriteriaSelective(record, example);
    }

    @Override
    @Transactional
    public int insertSelective(ManagerCertHistory record) {
        return this.managerCertHistoryMapper.insertSelective(record);
    }
}